//
//  YunDanCheckPhotoViewController.m
//  阿帕
//
//  Created by mac on 2020/1/8.
//  Copyright © 2020 GCY. All rights reserved.
//

#import "YunDanCheckPhotoViewController.h"

@interface YunDanCheckPhotoViewController ()

@end

@implementation YunDanCheckPhotoViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    [self setupBaseView];
}

- (void)setupBaseView {
    
    self.navigationItem.title = _navTitle;
//    self.view.backgroundColor = BackgroundColor;
    
    //标题
    UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 120, 40)];
    textLabel.text = @"* 点击查看大图";
    textLabel.textColor = Theme_ColorValue;
    textLabel.font = font(15);
    textLabel.adjustsFontSizeToFitWidth = YES;
    [self.view addSubview:textLabel];
    
    for (int i=0; i<self.photosArray.count; i++) {
        
        int x = i%3;
        int y = i/3;
        
        float width = (ScreenW-30-30)/3;
        
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((width+15)*x + 15, (width+15)*y + 40, width, width)];
        imageView.contentMode = UIViewContentModeScaleAspectFill;
        imageView.clipsToBounds = YES;
        setNetImage(imageView, self.photosArray[i], @"gcy_icon_plaholder");
        imageView.userInteractionEnabled = YES;
        [self.view addSubview:imageView];
        
        [imageView nyl_addTapGes:^{
            HZPhotoBrowser *browser = [[HZPhotoBrowser alloc] init];
            browser.isFullWidthForLandScape = YES;
            browser.isNeedLandscape = YES;
            browser.currentImageIndex = i;
            browser.imageArray = self.photosArray;
            [browser show];
        }];
    }
}

@end
